import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state:{
        token:"",
        user:{}
    },
    modules:{},
    mutations:{
        setToken(state,token){
            state.token = token
        },
        setUser(state,user){
            state.user = user
        },
        clearToken(state){
            state.token = ''
        }
    },

    actions:{},
    getters:{
        getToken(state){
            return state.token;
        },
        getUser(state){
            return state.user;
        }
    }
})
